/*
 * main.c
 *
 *  Created on: 29/gen/2014
 *      Author: Postazione Embedded
 */
//TX mario, RX diana
//canale 7a

#include "stm32f4xx.h"
#include "nrf24l01p/dl.h"

#define BUFFER_SIZE		32

uint8_t tx_buffer[BUFFER_SIZE];
static int prove = 100;

void loopr() {

}

void loopt() {
	int j = 0;
	for (; j< prove; j++){
		//printf("Pacchetto %d!!\n", j);
		TxFrame_nRF24L01P(tx_buffer, BUFFER_SIZE);
		//TxPacket(tx_buffer, BUFFER_SIZE);
		//printf("Pacchetto trasmesso!!\n");
	}


}

void finalize() {

}

int main() {
	int i = 0;
	int temp = 1;
	setup_nRF24L01P();
	RxMode_nRF24L01P();
	for(; i < BUFFER_SIZE; i++){
		tx_buffer[i] = i % 10;
	}
	printf("main\n");
	TxMode_nRF24L01P();
	while (1) {
		if (temp ==1){
			loopt();
			temp = 0;
			printf("Fine!!\n");
		}
		//printf("loopr\n");
		//RxPacket(tx_buffer);
		toggleLeds(LED[3]);


	}

	finalize();
}

